home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / python-support / python2.6 / rdflib / Variable.pyc (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-04-20  |  1.3 KB  |  35 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from rdflib.Identifier import Identifier
  5.  
  6. try:
  7.     from hashlib import md5
  8. except ImportError:
  9.     from md5 import md5
  10.  
  11.  
  12. class Variable(Identifier):
  13.     '''
  14.     '''
  15.     __slots__ = ()
  16.     
  17.     def __new__(cls, value):
  18.         return Identifier.__new__(cls, value)
  19.  
  20.     
  21.     def n3(self):
  22.         return '?%s' % self
  23.  
  24.     
  25.     def __reduce__(self):
  26.         return (Variable, (unicode(self),))
  27.  
  28.     
  29.     def md5_term_hash(self):
  30.         d = md5(str(self))
  31.         d.update('V')
  32.         return d.hexdigest()
  33.  
  34.  
  35.